-- You shouldn't be here. You will regret this decision.
-- Also I don't know optimization, okay? Again, you shouldn't even be here.

SaveData["episode"] = SaveData["episode"] or {}


function onEvent(eventName)
	if eventName == "Birdo1" then -- birdo 
		if globalsave.DefeatBirdo then 
		Text.showMessageBox("Birdo is defeated.")
		else
		Text.showMessageBox("Birdo is not defeated.")
		end
	elseif eventName == "Birdo2" then
		if globalsave.DefeatBirdo then 
		Text.showMessageBox("Birdo has been set to undefeated.")
		globalsave.DefeatBirdo = false
		else
		Text.showMessageBox("Birdo has been set to defeated.")
		globalsave.DefeatBirdo = true
		end
		
	elseif eventName == "Elevator1" then --elevator initialization
		if globalsave.FixElevator then 
		Text.showMessageBox("Elevator is fixed.")
		else
		Text.showMessageBox("Elevator is not fixed.")
		end
	elseif eventName == "Elevator2" then
		if globalsave.FixElevator then 
		Text.showMessageBox("Elevator is now broken again.")
		globalsave.FixElevator = false
		globalsave.CompleteSML = false
		else
		Text.showMessageBox("Elevator is now fixed up.")
		globalsave.FixElevator = true
		end
		
	elseif eventName == "Bitch1" then --bitchswitches
		if globalsave.CompleteSML then 
		Text.showMessageBox("Rest of elevator is accessible.")
		else
		Text.showMessageBox("Rest of elevator is not accessible.")
		end
	elseif eventName == "Bitch2" then
		if globalsave.CompleteSML then 
		Text.showMessageBox("You can no longer access the rest of the elevator's floors.")
		globalsave.CompleteSML = false
		else
		Text.showMessageBox("You can now access the rest of the floors of the elevator.")
		globalsave.FixElevator = true
		globalsave.CompleteSML = true
		end
		
	elseif eventName == "GarbageDay1" then --garbage blocking sml level
		if globalsave.GarbageDay then 
		Text.showMessageBox("The garbage is not there.")
		else
		Text.showMessageBox("The garbage is still there..")
		end
	elseif eventName == "GarbageDay2" then
		if globalsave.GarbageDay then 
		Text.showMessageBox("A fiend has put back the garbage.")
		globalsave.GarbageDay = false
		else
		Text.showMessageBox("The trash collector finally came by.")
		globalsave.GarbageDay = true
		end
		
	elseif eventName == "Cat1" then -- the secret level
		if globalsave.Cat then 
		Text.showMessageBox("The Cat is available.")
		else
		Text.showMessageBox("Hell has not been unleahsed yet.")
		end
	elseif eventName == "Cat2" then
		if globalsave.Cat then 
		Text.showMessageBox("We have tamed the horrors.")
		globalsave.Cat = false
		else
		Text.showMessageBox("The horrors have been unleashed.")
		globalsave.Cat = true
		end	
		
	elseif eventName == "Bridge1" then -- bridge to the next world
		if globalsave.BridgeLand then 
			Text.showMessageBox("A bridge between worlds exist!")
		else
			Text.showMessageBox("No bridge exists yet.")
		end
	elseif eventName == "Bridge2" then
		if globalsave.BridgeLand then 
			Text.showMessageBox("The bridge was destroyed.")
			globalsave.BridgeLand = false
		else
			Text.showMessageBox("A bridge has been placed down to the next world!")
			globalsave.BridgeLand = true
		end

	elseif eventName == "SML1" then -- super mario land 2
		if globalsave.SuperMarioLand2 then 
			Text.showMessageBox("Super Mario Land 2 has made it's way here!")
		else
			Text.showMessageBox("SML2 isn't real.")
		end
	elseif eventName == "SML2" then
		if globalsave.SuperMarioLand2 then 
			Text.showMessageBox("The gameboy was turned off.")
			globalsave.SuperMarioLand2 = false
		else
		Text.showMessageBox("SML2 is real now!")
			globalsave.SuperMarioLand2 = true
		end

	end
end